using System;
using System.Collections.Generic;
using Dict.DataModel;

namespace Dict.Dao
{
    public class TableEquipForgePropDao:DaoBase<TableEquipForgeProp>
    {
        public override void AddPrimaryIndex(TableEquipForgeProp model)
        {
            cachePrimary[model.id.ToString()] = model;
        }

        public override string GetFileName()
        {
            return "TableEquipForgeProp.txt";
        }

        protected override TableEquipForgeProp ParseRowData(string[] rowData)
        {
            TableEquipForgeProp data = new TableEquipForgeProp();
			data.id = rowData [0];
			data.equipId = rowData [1];

            if (string.IsNullOrEmpty(rowData[2]))
            {
                data.forgeLevel = 0;
            }
            else
            {
                data.forgeLevel = int.Parse(rowData[2]);
            }
			data.prop = rowData [3];

            return data;
        }


        public override void AddOneIndex(TableEquipForgeProp model)
        {
            if (!cacheOneIndex.ContainsKey(model.equipId.ToString()))
            {
                cacheOneIndex[model.equipId.ToString()] = new List<TableEquipForgeProp>();
            }
            cacheOneIndex[model.equipId.ToString()].Add(model);
        }
    

    }

}
